"""
37. Fixtures.

Fixtures are a way of loading data into the database in bluk. Fixture data 
can be stored in any serializable format (including JSON and XML). Fixtures
are identified by name, and are stored in either a directory named 'fixtures'
in the application directory, on in one of the directories named in the 
``FIXTURE_DIRS`` setting.
"""

from django.db import models


class Category(models.Model):
    title = models.CharField(max_length=100)
    description = models.TextField()
    
    def __unicode__(self):
        return self.title
    
    class Meta:
        ordering = ('title',)

class Article(models.Model):
    headline = models.CharField(max_length=100, default='Default headline')
    pub_date = models.DateTimeField()
    
    def __unicode__(self):
        return self.headline
    
    class Meta:
        ordering = ('-pub_date', 'headline')